package com.itheima.advance.anno.demo03;

import java.lang.reflect.Method;

public class Anno1Demo01 {

    public static void main(String[] args) throws Exception {

        Class<?> useTestClass = Class.forName("com.itheima.advance.anno.demo03.UseTest");
        UseTest useTest = (UseTest) useTestClass.newInstance();
        Method[] declaredMethods = useTestClass.getDeclaredMethods();
        for (Method method : declaredMethods){
            if (method.isAnnotationPresent(Test.class)){
                method.invoke(useTest);
            }
        }
    }
}
